/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pakazaka.controllers;

import com.pakazaka.layer.TiledLayer;
import com.pakazaka.player.Player;
import com.pakazaka.simplecrawler.Core;
import static com.pakazaka.simplecrawler.Core.getInstance;
import java.awt.event.KeyEvent;
import java.io.UnsupportedEncodingException;

/**
 *
 * @author Riseremi
 */
public class InventoryController {

    public static void processInventory(KeyEvent e) {
        Player player = getInstance().getPlayer();
        TiledLayer layer = getInstance().getLayer();
        Core core = getInstance();

        if (core.getInventory().isShowItemDescription()) {
            ItemActionController.processItemActions(e, core.getInventory().getDescriptionWindow());
        }

        try {
            core.getInventory().inventoryDescriptions(e, player.getAbsoluteBlocksX(),
                    player.getAbsoluteBlocksY(), player.getItems());
        } catch (UnsupportedEncodingException ex) {
        }
    }
}
